dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97905cc
)
ApiQueryCategories: Supply limit for DB query
author
Brad Jorsch
<bjorsch@wikimedia.org>
Wed, 28 Aug 2019 20:34:30 +0000
(16:34 -0400)
committer
Mobrovac
<mobrovac@wikimedia.org>
Mon, 2 Sep 2019 11:39:45 +0000
(11:39 +0000)
The limit is applied in PHP, but all matching rows are being fetched
from the database. We should only fetch the number of rows needed.
Bug: T231462
Change-Id: Ie64ea6f79a187942c476868c383a1349d110aa7c
includes/api/ApiQueryCategories.php
patch
|
blob
|
history
diff --git
a/includes/api/ApiQueryCategories.php
b/includes/api/ApiQueryCategories.php
index
547a4e8
..
79347e6
100644
(file)
--- a/
includes/api/ApiQueryCategories.php
+++ b/
includes/api/ApiQueryCategories.php
@@
-127,6
+127,7
@@
class ApiQueryCategories extends ApiQueryGeneratorBase {
'cl_to' . $sort
] );
}
+ $this->addOption( 'LIMIT', $params['limit'] + 1 );
$res = $this->select( __METHOD__ );